package com.hznu.stmanage.serviceImpl;

import com.hznu.stmanage.dao.RecruitInfoMapper;
import com.hznu.stmanage.entity.RecruitInfo;
import com.hznu.stmanage.service.BaseService;
import com.hznu.stmanage.service.RecruitInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by J_Vino on 16/3/6.
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class RecruitInfoServiceImpl extends BaseService implements RecruitInfoService {

    RecruitInfoMapper recruitInfoMapper = null;
    public void setMapper()
    {
        if(recruitInfoMapper==null)
            recruitInfoMapper = getRecruitInfoMapper();//1.获取相关mapper
    }
    public int deleteByPrimaryKey(Long id) {
        setMapper();
        return recruitInfoMapper.deleteByPrimaryKey(id);
    }

    public int insert(RecruitInfo record) {
        setMapper();
        return recruitInfoMapper.insert(record);
    }

    public int insertSelective(RecruitInfo record) {
        setMapper();
        return recruitInfoMapper.insertSelective(record);
    }

    public RecruitInfo selectByPrimaryKey(Long id) {
        setMapper();
        return recruitInfoMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(RecruitInfo record) {
        setMapper();
        return recruitInfoMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(RecruitInfo record) {
        setMapper();
        return recruitInfoMapper.updateByPrimaryKey(record);
    }
}
